<template>
  <div>
    <van-field
      v-model="data"
      type="number"
      :label="label"
      :placeholder="placeholder"
    />
  </div>
</template>

<script>
export default {
  name: 'FieldNumber',
  props: {
    value: { type: Number, default: 0 },
    label: { type: String, default: '' },
    placeholder: { type: String, default: '' }
  },

  data() {
    return {}
  },
  computed: {
    data: {
      get() {
        return this.value
      },
      set(val) {
        this.$emit('input', Number(val))
      }
    }
  },

  async created() {},

  methods: {}
}
</script>

<style type="text/css"></style>
